package org.xdq.base;


public class Result {
	
	/**
	 * 未登录
	 * @return
	 */
	public static Result unLogged() {
		return new Result();
	}
	
	public static Result success() {
		return new Result(true,null,null);
	}
	
	public static Result success(String message) {
		return new Result(true,message,null);
	}
	
	public static Result success(String message,Object data) {
		return new Result(true,message,data);
	}
	
	
	public static Result fail() {
		return new Result(false,null,null);
	}
	
	public static Result fail(String message) {
		return new Result(false,message,null);
	}
	
	public static Result fail(String message,Object data) {
		return new Result(false,message,data);
	}
	
	
	private boolean success;
	private String message;
	private Object data;
	
	private boolean logined;//是否登录
	
	private Result(boolean success, String message, Object data) {
		super();
		this.success = success;
		this.message = message;
		this.data = data;
		
		this.logined = true;
	}
	
	private Result() {
		this.logined = false;
	}

	public boolean isSuccess() {
		return success;
	}

	public String getMessage() {
		return message;
	}

	public Object getData() {
		return data;
	}

	public boolean isLogined() {
		return logined;
	}
	
	

}
